package com.ahsjdy.st.stdao.mapper;

import com.ahsjdy.st.stdao.entity.Merchant;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface MerchantMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(Merchant record);

    int insertSelective(Merchant record);

    Merchant selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(Merchant record);

    int updateByPrimaryKey(Merchant record);

    int updateStatus(@Param("merchantId") Integer merchantId,
                     @Param("oldStatus")Integer oldStatus,
                     @Param("newStatus")Integer newStatus);

    List<Merchant> listMerchant(@Param("merchantName")String merchantName,
                                @Param("status")Integer status,
                                @Param("areaId")Integer areaId,
                                @Param("offset")Integer offset,
                                @Param("pageSize")Integer pageSize);

    int countMerchant(@Param("merchantName")String merchantName,
                      @Param("status")Integer status,
                      @Param("areaId")Integer areaId);

    Merchant getByOpenId(@Param("openId") String openId);


    List<Merchant> list4Customer(@Param("areaId") Integer areaId);
}